package celular.cadastrar;

import celular.FormLogin;
import celular.Main;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.ChoiceGroup;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;

public class FormCadastrarUsuario extends Form implements CommandListener {

	private Command commandVoltar, commandCadastrar;
	private boolean cadastrado = false;
	private Main main;
	private Form formAnterior;
	private TextField textNomeExibicao;
	private TextField textLogin;
	private TextField textSenha;
	private TextField textSenhaRepetida;
	private TextField textEmail;
	private TextField dataDeNascimento;	
	private TextField textEndereco;
	private TextField textDataDeNascimento;
	private TextField textQuemSouEu;
	private TextField textInteresses;
	private TextField textFilmesFavoritos;
	private TextField textMusicasFavoritas;
	private TextField textLivrosFavoritos;
	
	private ChoiceGroup choiseSexo;	
	private boolean CadastroCompleto = false;
	
	private String [] sexo = {"Masculino","Femenino"};


	

	public FormCadastrarUsuario(String titulo, Main main, Form formAnterior)
	{
		
		super(titulo);
		
		this.main = main;
		
		
		this.commandVoltar = new Command("Voltar", Command.OK, 0);	
		this.commandCadastrar = new Command("Cadastrar", Command.OK, 1);	

		addCommand(this.commandVoltar);	
		addCommand(this.commandCadastrar);

		append(this.textNomeExibicao = new TextField("Nome de Exibicao:", "", 30, TextField.ANY));
		append(this.textLogin = new TextField("Login:", "", 15, TextField.ANY));
		append(this.textSenha = new TextField("Senha:", "", 30, TextField.ANY | TextField.PASSWORD));
		append(this.textSenhaRepetida = new TextField("Repita a Senha:", "", 20, TextField.ANY | TextField.PASSWORD));
		append(this.textLogin = new TextField("E-Mail:", "", 20, TextField.EMAILADDR));
		append(this.choiseSexo = new ChoiceGroup("Sexo :",Choice.EXCLUSIVE,sexo, null));
		append(this.textDataDeNascimento= new TextField("Data de Nascimento :", "", 10, TextField.ANY));
		append(this.textQuemSouEu= new TextField("Quem sou Eu :  :", "", 200, TextField.ANY));
		append(this.textInteresses= new TextField("Interesses :", "", 200, TextField.ANY));
		append(this.textFilmesFavoritos= new TextField("Filmes Favoritos :", "", 200, TextField.ANY));
		append(this.textMusicasFavoritas= new TextField("Musicas Favoritas :", "", 200, TextField.ANY));
		append(this.textLivrosFavoritos= new TextField("Livros Fvoritos :", "", 200, TextField.ANY));
		
		
		
		setCommandListener(this);    
		
		
	}
	
	
	public void commandAction(Command c, Displayable d)
	{
		if (c == this.commandVoltar) {
			this.main.getTela().setCurrent(this.formAnterior);
		}
		if (c == this.commandCadastrar) {
			this.main.getTela().setCurrent(new FormLogin("Login",this.main));
		}
	}
	

}
